#!/bin/bash

## yazi + helix + python-lsp-server 即兴安装脚本

# 安装python等依赖
sudo apt install -y \
python3 python3-pip python3-venv \
wget tar xz-utils unzip file

# 安装 Python 语言服务器
PY_VDIR=$HOME/Python-Lsp-Server
python3 -m venv $PY_VDIR # 创建虚拟环境
. $PY_VDIR/bin/activate # 进入环境
pip3 install python-lsp-server
deactivate # 退出环境

# 安装 yazi 和 helix
# 下载二进制程序
wget \
https://ghp.ci/github.com/helix-editor/helix/releases/download/24.07/helix-24.07-aarch64-linux.tar.xz \
https://ghp.ci/github.com/sxyazi/yazi/releases/download/v0.3.2/yazi-aarch64-unknown-linux-gnu.zip

# 创建目录并解压到目录
mkdir -p $HOME/editor/{helix,yazi}
tar -xvf helix-24.07-aarch64-linux.tar.xz -C $HOME/editor/helix/
unzip yazi-aarch64-unknown-linux-gnu.zip -d $HOME/editor/yazi/

# 完成
